package com.chushouya.common.constant;

import com.general.framework.core.enums.IEnum;

import java.util.Objects;

public enum AdminUserType implements IEnum<Integer> {

    ADMIN_PLATFORM(10, "后台管理用户"),
    ADMIN_MERCHANT(2, "后台回收商用户"),
    ADMIN_PROXY(30, "代理商用户");

    private Integer value;
    private String desc;

    AdminUserType(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }

    public static String getDesc(Integer value) {
        for (AdminUserType thisEnum : AdminUserType.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return "";
    }
}
